<template>
	<div class="download">
		<div class="origin" :class="{ show: className }">
			<div class="inwxtip-wrap">
				<span>请点击右上角按钮，然后在弹出的菜单中，点击在浏览器中打开，即可下载</span>
				<img src="../assets/200.png" />
			</div>
		</div>
		<div class="download-logo"><img src="../assets/logo.png" /></div>
		<h1>BHT APP下载</h1>
		<div class="download-ios">
			<img class="img" src="../assets/IOS.png" />
			<div class="download-btn" @click="download('https://www.lanzous.com/bht-app-ios')">苹果版下载</div>
		</div>
		<div class="download-andriod">
			
			<img class="img" src="../assets/andriod.png" />
			<div class="download-btn" @click="download('https://www.lanzous.com/bht-app-andriod')">安卓版下载</div>
		</div>
	</div>
</template>
<script>
import Toast from 'vant/lib/toast';
import 'vant/lib/toast/style';
export default {
	data() {
		return {
			className: false
		};
	},
	created() {
		this.isWeiXin();
	},
	methods: {
		isWeiXin() {
			const ua = window.navigator.userAgent.toLowerCase();
			if (ua.match(/MicroMessenger/i) == 'micromessenger') {
				this.className = true;
			} else {
				this.className = false;
			}
		},
		download(url) {
			Toast.loading({
				mask: true,
				message: '正在跳转...'
			});
			window.location.href = url;
		}
	}
};
</script>
<style lang="scss" scoped>
.origin {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	transform: translate3d(0, -100%, 0);
	transition: transform 1s;
	&.show {
		transform: translate3d(0, 0, 0);
	}
}
.inwxtip-wrap {
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
	padding: 5px 15px;
	font-size: 0.13rem;
	color: #ddd;
	line-height: 1.5;
	background-color: rgba(0, 0, 0, 0.7);
}
.inwxtip-wrap span {
	flex: 1;
}
.download {
	position: relative;
	height: 100vh;
	background-color: #fff;
	&-logo {
		width: 1rem;
		height: 1rem;
		margin: auto;
		padding-top: 0.5rem;
		text-align: center;
		img {
			width: 100%;
			height: 100%;
		}
	}
	h1 {
		font-size: 0.3rem;
		margin-top: 0.1rem;
		margin-bottom: 0.6rem;
		text-align: center;
	}
	&-ios,
	&-andriod {
		margin-bottom: 0.3rem;
		text-align: center;
		.img {
			display: block;
			width: 0.3rem;
			height: 0.3rem;
			margin: 0 auto 0.2rem auto;
		}
	}
	.load-btn {
		margin-top: 0.1rem;
		margin-bottom: 0.3rem;
		text-align: center;
	}
	&-btn {
		display: block;
		width: 50%;
		margin: auto;
		height: 0.4rem;
		line-height: 0.4rem;
		margin-top: 0.2rem;
		text-align: center;
		color: #fff;
		border: 0;
		font-size: 0.15rem;
		background: #3e527e;
		border-radius: 0.6rem;
		box-shadow: 0 0.02rem 0.06rem #ddd;
	}
}
</style>
